﻿using System;
using EkStudio.com.bean.xml.Unit;
using EkStudio.com.bean.xml.reflection;

namespace EkStudio.com.bean.xml.RootInterface.Field
{
    public class BillUiFieldsItem:BillObjectInterface,BillUiFormatNode
    {
        
        
        [Xml("caption")]
        public string Caption
        {
            get
            {
                return caption;
            }

            set
            {
                caption = value;
            }
        }
        [Xml("key")]
        public string Key
        {
            get
            {
                return key;
            }

            set
            {
                key = value;
            }
        }
        [Xml("languageTexts")]
        public string LanguageTexts
        {
            get
            {
                return languageTexts;
            }

            set
            {
                languageTexts = value;
            }
        }
        [XmlElement("dataProperties")]
        public BillUiFieldsDataProperty DataProperty
        {
            get
            {
                return dataProperty;
            }

            set
            {
                dataProperty = value;
            }
        }
        [XmlElement("editProperties")]
        public BillUiFieldsEditProperty EditProperty
        {
            get
            {
                return editProperty;
            }

            set
            {
                editProperty = value;
            }
        }
        [XmlElement("formula")]
        public BillUiFieldsFormulaProperty FormulaProperty
        {
            get
            {
                return formulaProperty;
            }

            set
            {
                formulaProperty = value;
            }
        }
        [XmlElement("editUIProperties")]
        public BillUiFieldsEditBorderProperty EditBorder
        {
            get
            {
                return editBorder;
            }

            set
            {
                editBorder = value;
            }
        }
        [XmlElement("viewUIProperties")]
        public BillUiFieldsViewBorderProperty ViewBorder
        {
            get
            {
                return viewBorder;
            }

            set
            {
                viewBorder = value;
            }
        }
        [XmlTransient]
        public object ParentBean
        {
            get
            {
                return null;
            }

            set
            {
                
            }
        }

        public object Clone()
        {
            BillUiFieldsItem clone = new BillUiFieldsItem();
            clone.Key =key;
            clone.Caption = caption;
            Object temp = null;
            if (dataProperty != null)
            {
                temp = dataProperty.Clone();
                if (temp != null)
                {
                    clone.DataProperty = (BillUiFieldsDataProperty)temp;
                }
            }
            else
            {
                clone.DataProperty = new BillUiFieldsDataProperty();
            }
            if (editProperty != null)
            {
                temp = editProperty.Clone();
                if (temp != null)
                {
                    clone.EditProperty = (BillUiFieldsEditProperty)temp;
                }
            }
            else
            {
                clone.EditProperty = new BillUiFieldsEditProperty();
            }
            clone.FormulaProperty = new BillUiFieldsFormulaProperty();
            if (editBorder != null)
            {
                temp = editBorder.Clone();
                if (temp != null)
                {
                    clone.EditBorder = (BillUiFieldsEditBorderProperty)temp;
                }
            }
            if (viewBorder != null)
            {
                temp = viewBorder.Clone();
                if (temp != null)
                {
                    clone.ViewBorder = (BillUiFieldsViewBorderProperty)temp;
                }
            }
            return clone;
        }

        public override string ToString()
        {
            return caption;
        }


        private string key = BeanUtil.FIELD_KEY_VALUE;
        private string caption = BeanUtil.FIELD_CAPTION_VALUE;
        private string languageTexts ="";

        private BillUiFieldsDataProperty dataProperty;
        private BillUiFieldsEditProperty editProperty;
        private BillUiFieldsFormulaProperty formulaProperty;
        private BillUiFieldsEditBorderProperty editBorder;
        private BillUiFieldsViewBorderProperty viewBorder;
    }
}
